<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<!DOCTYPE html>
<html>
<head>

	<title>推荐历史</title>
	<t:base type="jquery,easyui,tools,DatePicker"></t:base>
	<script>
		$(function() {
			mallProductRecommendModule.init();
		});
		var mallProductRecommendModule = (function(){
			var fileChange = function () {
				$("#image").bind("change", function(e){
					var file = e.target.files || e.dataTransfer.files;
					if (file) {
						var reader = new FileReader();
						reader.onload = function () {
							$("#imageUrl").attr("src", this.result);
						};
						reader.readAsDataURL(file[0]);
					}
				})
			}
			var module = {
				init :function(){
					fileChange();
				},
			}
			return module;
		})();

	</script>
</head>
<body style="overflow-y: hidden" scroll="no">
<form id="formobj" name="formobj" method="post"  enctype="multipart/form-data"   action="mallProductRecommendController.do?save">
	<input id="id" name="id" type="hidden" value="${mallProductRecommendHistoryPage.id }">
	<input id="btn_sub" class="btn_sub" type="hidden">
	<input id="recommendtype_v" name="recommendtype" type="hidden" value="${mallProductRecommendHistoryPage.recommendtype}">
	<table style="width: 600px;" cellpadding="0" cellspacing="1" class="formtable">
		<tr>
			<td align="right">
				<label class="Validform_label">
					商品id:
				</label>
			</td>
			<td class="value">
				<input class="inputxt" id="productid" name="productid"
					   value="${mallProductRecommendHistoryPage.productid}" readonly="true">
				<span class="Validform_checktip"></span>
			</td>
		</tr>
		<tr>
			<td align="right">
				<label class="Validform_label">
					商品名称:
				</label>
			</td>
			<td class="value">
				<input class="inputxt" id="productname" name="productname"
					   value="${mallProductRecommendHistoryPage.productname}" datatype="*">
				<span class="Validform_checktip"></span>
			</td>
		</tr>
		<tr>
			<td align="right">
				<label class="Validform_label">
					商品图片:
				</label>
			</td>
			<td class="value">
				<input type="file"  id="image"  name="image"  <c:if test="${mallProductRecommendHistoryPage.imagesrc == null}">datatype="*"</c:if>>
				<span class="Validform_checktip"></span>
			</td>
		</tr>
		<tr>
			<td align="right">
				<label class="Validform_label">
					商品图片:
				</label>
			</td>
			<td class="value">
				<div id="imageShow"> </div>
				<span class="Validform_checktip"></span>
			</td>
		</tr>
		<tr>
			<td align="right">
				<label class="Validform_label">
					旧图片:
				</label>
			</td>
			<td class="value">
				<img id="imageUrl" width="250px" height="150px" <c:if test="${mallProductRecommendHistoryPage.imagesrc != null}"> src="${mallProductRecommendHistoryPage.imagesrc}"</c:if>>
				<span class="Validform_checktip"></span>
			</td>
		</tr>
		<tr>
			<td align="right">
				<label class="Validform_label">
					商品类型:
				</label>
			</td>
			<td class="value">
				<select name="recommendtype" datatype="*" id="recommendtype" <c:if test="${mallProductRecommendHistoryPage.id != null}"> disabled </c:if>>
					<option value="">请选择</option>
					<option value="1" <c:if test="${mallProductRecommendHistoryPage.recommendtype == 1}"> selected</c:if>>每日推荐</option>
					<option value="2" <c:if test="${mallProductRecommendHistoryPage.recommendtype == 2}"> selected</c:if>>拉货宝精选</option>
				</select>
				<span class="Validform_checktip"></span>
			</td>
		</tr>
		<tr>
			<td align="right">
				<label class="Validform_label">
					排序:
				</label>
			</td>
			<td class="value">
				<input class="inputxt" id="sort" name="sort"
					   value="${mallProductRecommendHistoryPage.sort}" datatype="n" <c:if test="${mallProductRecommendHistoryPage.id != null}"> readonly="true"</c:if>  >
				<span class="Validform_checktip"></span>
			</td>
		</tr>
	</table>
</form>
<link type="text/css" href="plug-in/Validform/css/metrole/style.css" rel="stylesheet">
<link type="text/css" href="plug-in/Validform/css/metrole/tablefrom.css" rel="stylesheet">
</body>